home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_300 / 310_02 / string.h < prev    next >
C/C++ Source or Header  |  1990-04-18  |  733b  |  28 lines

  1. /*
  2.     Little Smalltalk string definitions
  3. */
  4. /*
  5.     for strings s_size = STRINGSIZE
  6.  
  7.     Unlike other special objects (integers, floats, etc), strings
  8.     must keep their own super_obj pointer, since the class
  9.     ArrayedCollection (a super class of String) contains instance
  10.     variables, and thus each instance of String must have a unique
  11.     super_obj.
  12. */
  13.  
  14. struct string_struct {
  15.     int    s_ref_count;
  16.     int    s_size;
  17.     object     *s_super_obj;
  18.     char    *s_value;
  19.     } ;
  20.  
  21. typedef struct string_struct string;
  22.  
  23. extern object *new_str();        /* make a new string object */
  24. extern string *new_istr();        /* internal form of new string */
  25. extern char   *walloc();        /* allocate a copy a word */
  26.  
  27. # define string_value(x) (((string *) x)->s_value)
  28.